<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 *员工列表
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'oneadd';
$tabs=array(
	array('op'=>'oneadd','title'=>'交定金'),
);
if($_RQ['op']=='oneadd'){
	if($_RQ['postdata']){
		$post=get_postdata();
		if(intval($post['fee'])<=0){
			exi('请输入定金金额！','error');
		}
		$data=array(
			'memberid'=>intval($post['memberid']),
			'fee'=>intval($post['fee']),
			'remark'=>trim($post['remark']),
			'workerid'=>intval($_SESSION['workerid']),
			'type'=>2,
		);
		$id=intval($post['id']);
		if($id){
			$data['up_time']=time();
			$this->update('infee_log',$data,array('id'=>$id));
		}else{
			$data['uniacid']=$_SESSION['uniacid'];
			$data['storeid']=$_SESSION['storeid'];
			$data['createtime']=time();
			$this->insert('infee_log',$data);
		}
		exi('交定金成功','','/juese14.infee_log/list/');
	}
	$return['item']=array();
	$htmls=array(
		'type'=>'edit',
		'desc'=>'交定金',
		'edit'=>array(
			array('type'=>'unitstring','unit'=>'元','title'=>'金额','name'=>'fee'),
			array('name'=>'memberid','title'=>'选择客户','type'=>'choose','action'=>'jy_yxw/get_member/'),
			array('type'=>'text','title'=>'备注信息','name'=>'remark'),
		),
	);
	$return['htmls']=$htmls;
	exi($return);
}